<template>
  <view class="container">
    <!-- <view class="navbar"> -->
    <navbar ref="navbar" :config="config">
    </navbar>
    <!-- </view> -->
    <!-- <顶部> -->
    <view class="top">
      <!-- <背景图>$mConfig.staticUrl http://192.168.0.119/ycimg -->
      <!-- <image :src="imgUrl + '/my-top-bgImg.png'"></image> -->
      <!-- <image src="http://192.168.0.119/ycimg/my-top-bgImg.png"></image> -->
      <view class="bgImg">
        <!-- <image :src="imgUrl+'/my-list-bgImg.png'"></image> -->
        <view class="position-ab">
          <!-- <view class="top-data-box2">
            <view class="item" @click="tabPage('/pages/signCenter/index',true)">
              <view>
                <view class="title">每日签到</view>
                <view class="tip">签到得爱心</view>
              </view>
              <view class="icon" :class="isSign?'active':''">
                <text class="iconfont2">&#xe60d;</text>
              </view>
            </view>
            <view class="line"></view>
            <view class="item" @click="tabPage('/pages/operationCenter/index',true)">
              <view>
                <view class="title">推广明细</view>
                <view class="tip">推广赚零钱</view>
              </view>
              <view class="icon">
                <text class="iconfont2" style="font-size: 32rpx;">&#xe684;</text>
              </view>
            </view>
            <view class="line"></view>
            <view class="item" @click="tabPage('/pages/couponCenter/index')">
              <view>
                <view class="title">领券中心</view>
                <view class="tip">领取得福利</view>
              </view>
              <view class="icon">
                <text class="iconfont2" style="font-size: 34rpx;">&#xe8c0;</text>
              </view>
            </view>
          </view> -->
          <view class="middle">
            <view class="middle-top">
              <view style="display: flex;justify-content: space-between;width: 300rpx;">
                <view class="order" v-for="(item,index) in orderTypeList" :key="index"
                  :class="orderTypeIndex==index?'active':''" @click="orderTypeIndex=index;getGeneralOrderCount()">
                  {{item.text}}
                </view>
              </view>
              <view class="whole" @click="linkOrderList(-1)">
                <view class="whole-top">
                  查看全部
                </view>
                <view class="iconfont wholeright">&#xe6c7;</view>
              </view>
            </view>
            <view class="middle-content">
              <view class="list" @click="linkOrderList(0)">
               <view class="anglenum" v-if="generalOrder.waitPayNum=='0'?false:generalOrder.waitPayNum">
                  {{generalOrder.waitPayNum}}
                </view>
                <!-- <text class="iconfont one">&#xe697;</text> -->
                <view class="name-one">
                  待付款
                </view>
				<image class="my-icon" src="https://zhongyi-shop.oss-cn-beijing.aliyuncs.com/songhe/weixin/static/order/payment.png"></image>
              </view>
              <view class="list" @click="linkOrderList(1)">
                <view class="anglenum" v-if="generalOrder.waitShipNum=='0'?false:generalOrder.waitShipNum">
                  {{generalOrder.waitShipNum}}
                </view>
                <!-- <text class=" iconfont two">&#xe621;</text> -->
				<view class="name-one">待发货 </view>
                <image class="my-icon" src="https://zhongyi-shop.oss-cn-beijing.aliyuncs.com/songhe/weixin/static/order/seed-goods.png"></image>
              </view>
              <view class="list" @click="linkOrderList(3)">
                <view class="anglenum" v-if="generalOrder.waitReceivingNum=='0'?false:generalOrder.waitReceivingNum">
                  {{generalOrder.waitReceivingNum}}
                </view>
                <!-- <text class="iconfont three">&#xe63f;</text> -->
                <view class="name-one">待收货 </view>
				<image class="my-icon" src="https://zhongyi-shop.oss-cn-beijing.aliyuncs.com/songhe/weixin/static/order/take-goods.png"></image>
              </view>
              <view class="list" @click="linkOrderList(5)">
                <view class="anglenum" v-if="generalOrder.waitCommentNum=='0'?false:generalOrder.waitCommentNum">
                  {{generalOrder.waitCommentNum}}
                </view>
                <!-- <text class="iconfont four">&#xe61b;</text> -->
                <!-- <image class="my-icon" :src="imgUrl+'/login/noevaluate.png'"></image> -->
                <view class="name-one">待评价 </view>
				<image class="my-icon1" src="https://zhongyi-shop.oss-cn-beijing.aliyuncs.com/songhe/weixin/static/order/estimate.png"></image>
              </view>
              <view class="list" @click="linkOrderList(6)">
                <!-- <view class="anglenum">1</view> -->
                <!-- <text class="iconfont five">&#xe9ae;</text> -->
                <view class="name-one">退换/售后 </view>
				<image class="my-icon1" src="https://zhongyi-shop.oss-cn-beijing.aliyuncs.com/songhe/weixin/static/order/sale.png" style="width: width: 60rpx;"></image>
              </view>
            </view>
          </view>

          <view class="other" v-if="false">
            <view class="other-top" @click="linkServiceOrderList(-1)">
              <view class="left">
                服务订单
              </view>
              <view class="right">
                查看全部<text class="iconfont"
                  style="color: #999999; margin-left: 16rpx; font-size: 35rpx;margin-top: 0;">&#xe6c7;</text>
              </view>

            </view>
            <view class="option">
              <view class="list" @click="linkServiceOrderList(0)">
                <view class="othernum" v-if="serviceOrder.waitPayNum=='0'?false:serviceOrder.waitPayNum">
                  {{serviceOrder.waitPayNum}}
                </view>
                <text class="iconfont one">&#xe697;</text>
                <view class="name-one">待付款</view>
              </view>
              <view class="list" @click="linkServiceOrderList(3)">
                <view class="othernum" v-if="serviceOrder.waitUseNum=='0'?false:serviceOrder.waitUseNum">
                  {{serviceOrder.waitUseNum}}
                </view>
                <!-- <text class=" iconfont two">&#xe621;</text> -->
                <image class="my-icon" :src="imgUrl+'/login/nouse.png'"></image>
                <view class="name-one">待使用 </view>
              </view>
              <view class="list" @click="linkServiceOrderList(5)">
                <view class="othernum" v-if="serviceOrder.waitCommentNum=='0'?false:serviceOrder.waitCommentNum">
                  {{serviceOrder.waitCommentNum}}
                </view>
                <!-- <text class="iconfont four">&#xe61b;</text> -->
                <image class="my-icon" :src="imgUrl+'/login/noevaluate.png'"></image>
                <view class="name-one">待评价 </view>
              </view>
              <view class="list" @click="linkServiceOrderList(6)">
                <!-- <view class="othernum">1</view> -->
                <text class="iconfont five">&#xe9ae;</text>
                <view class="name-one">轻松退 </view>
              </view>
            </view>
          </view>

        </view>
        <view class="position-ab">
          <view class="other">
            <view class="other-top" @click="affiliateMerchantOrderList">
              <view class="left">联盟商家订单</view>
              <view class="right">
                查看全部<text class="iconfont"
                  style="color: #999999; margin-left: 16rpx; font-size: 35rpx;margin-top: 0;">&#xe6c7;</text>
              </view>
            </view>
            <view class="order-info">
              <view class="item">
				<view class="">订单数</view>
                <view class="num">{{affiliateMerchantOrderInfo.order_num || 0}}</view>
              </view>
              <view class="item">
				<view class="">消费金额(￥)</view>
                <view class="num">{{affiliateMerchantOrderInfo.sale_money_total || 0}}</view>
              </view>
              <view class="item">
				<view class="">打赏金额(￥)</view>
                <view class="num">{{affiliateMerchantOrderInfo.discount_money_total || 0}}</view>
              </view>
            </view>
          </view>
        </view>
      </view>

      <!-- 猜你喜欢 -->
      <view class="guess">
        <view class="guess-top">
          <view class="guess-left">猜你喜欢</view>
          <view class="guess-line"></view>
          <view class="guess-right">智能推荐你感兴趣的优品</view>
        </view>
        <view class="guess-item" v-if="goodsList && goodsList.length > 0">
          <view class="item" @click="goProductDetails('/pages/product/goods/goods?id=' + item.id)"
            v-for="(item, index) in goodsList" :key="index">
            <image v-if="item && item.cover" :src="item.cover" mode="aspectFill"></image>
            <view style=" padding-bottom: 40rpx;">
			  <view class="number">
				<view class="number-red">
				  <rich-text :nodes="$mUtil.priceBigSmall(item.min_sale_price)"></rich-text>
				</view>
				<view class="number-grey">￥{{ item.max_market_price }}</view>
			  </view>
              <view class="name" style="flex: 1;">{{ item.title }}</view>
            </view>


          </view>
        </view>
        <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
        <loadMore v-if="goodsList.length > 0" :status="status"></loadMore>
      </view>
      <!-- 猜你喜欢 -->
    </view>
    <!-- <entrepreneurship-zone-tabbar :current="3"></entrepreneurship-zone-tabbar> -->
  </view>


</template>

<script>
  import {
    myInfo,
    getAccountInfo
  } from "@/api/login.js"
  import {
    myStatistics,
    unreadNum
  } from "@/api/userInfo.js"
  let app = getApp()
  export default {
    data() {
      return {
        config: {
          back: false, //false是tolbar页面 是则不写
          title: '订单',
          color: '#FFFFFF',
          //背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
          backgroundColor: [1, "#FF721B"],
          rightSlot: true,
        },
        imgUrl: this.$mConfig.staticUrl,
        //微信小程序用户信息
        userInfo: {
          head_photo: "",
          nickname: "登录/注册"
        },
        hiddenLink: true,
        loginNo: false, //判断显示邀请码
        storage: true,
        isLogin: false, //判断是否登录
        userInformation: {}, //用户信息
        myCommunity: {}, //我的社区
        myMsg: null,
        //服务订单数量
        serviceOrder: {
          waitPayNum: "0", //待支付数量
          waitCommentNum: "0", //待评论数量
          waitUseNum: "0" //待使用数量
        },
        //服务订单数量
        generalOrder: {
          waitPayNum: "0", //待支付数量
          waitCommentNum: "0", //待评论数量
          waitUseNum: "0", //待使用数量
          waitShipNum: "0", //待发货数量
          waitReceivingNum: "0" //待收货数量
        },
        ispay: app.globalData.openPay,
        topData: [{
          title: '我的爱心',
          value: '0'
        }, {
          title: '今日爱心',
          value: '0'
        }, {
          title: '公益积分',
          value: '0'
        }, {
          title: '优惠券',
          value: '0'
        }],
        numObj: {},
        //value对应订单列表接口的area_feature参数。传0或不传是排除了申购的订单列表（商品订单），传3是申购订单列表
        orderTypeList: [{
            text: '商品订单',
            value: 0
          },
          // {
          //   text: '申领订单',
          //   value: 3
          // },
        ],
        orderTypeIndex: 0,
        isSign: false, // 是否签到
        goodsList: [],
        page: 1,
        status: 'more',
        affiliateMerchantOrderInfo: {}
      }
    },
    created() {
      let userInfo = uni.getStorageSync("token")
      let shop = uni.getStorageSync("shop")
    },
    onReachBottom() {
      if (this.status == 'more') {
        this.page++;
        this.guessLike();
        if (this.isLogin) {
          this.getGeneralOrderCount()
        }
      }
      // this.status = "loading";

    },
    onPageScroll(e) {
      let maxHeight = uni.upx2px(300);
      if (e.scrollTop > maxHeight) {
        // this.$set(this.config, 'backgroundColor', [1, '#2cba28']);
      } else {
        // this.$set(this.config, 'backgroundColor', [e.scrollTop / maxHeight.toFixed(1), '#2cba28']);
      }
      // this.$refs.navbar.init();
    },
    //清空数据
    //显示弹出框
    async onShow() {
      var that = this
      let token = uni.getStorageSync('token')
      let shop = uni.getStorageSync("shop")
      this.guessLike();
      // let personal = uni.getStorageSync("personal")
      await this.judgeLogin()
        .catch(err => {
          /**
           * @description 重置数据
           */
          this.isLogin = false;
          this.userInformation = {}; //用户信息
          //服务订单数量
          this.serviceOrder = {
              waitPayNum: "0", //待支付数量
              waitCommentNum: "0", //待评论数量
              waitUseNum: "0" //待使用数量
            },
            //服务订单数量
            this.generalOrder = {
              waitPayNum: "0", //待支付数量
              waitCommentNum: "0", //待评论数量
              waitUseNum: "0", //待使用数量
              waitShipNum: "0", //待发货数量
              waitReceivingNum: "0" //待收货数量
            }
          for (let i in this.topData) {
            this.topData[i].value = 0;
          }
          this.isSign = false;
        })
      // let getWxUserInfo = uni.getStorageSync("wxUserInfo")
      // if(getWxUserInfo !=''){
      // 	that.userInfo = JSON.parse(getWxUserInfo)
      // }
      if (this.isLogin) {
        if (token) {
          this.hiddenLink = false
          this.loginNo = true
          this.getuserInfo()
        }
        await this.getMyStatistics()
        // await this.getUnreadNum()
        await this.getServiceOrderCount()
        await this.getGeneralOrderCount()
        await this.getAffiliateMerchantOrder()
        this.$forceUpdate();
      }
    },
    onPullDownRefresh() {
      let token = uni.getStorageSync("token")
      if (!token) {
        uni.stopPullDownRefresh();
      } else {
        this.page = 1;
        this.getGeneralOrderCount()
        this.guessLike();
        this.getAll()
      }

    },
    methods: {
      /**猜你喜欢 */
      guessLike() {
        this.keyWord = uni.getStorageSync("history") ? uni.getStorageSync("history").join(",") : ''
        this.$http
          .get(
            `/goods/smart`, {
              page: this.page,
              limit: 6,
              keywords: this.keyWord,
            },
            false
          )
          .then((res) => {
            if (res && res.code == 200) {

              this.goodsList = this.page == 1 ? res.page.list : this.goodsList.concat(res.page.list);
              if (res.page.totalPage <= res.page.currPage) {
                this.status = "noMore";
              } else {
                this.status = "more";
              }
            }
          });
      },
      // 商品跳转
      goProductDetails(url) {
        uni.navigateTo({
          url: url,
        });
      },
      // 上部切换
      topDataChange(e) {
        let token = uni.getStorageSync("token")
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
          return;
        }
        if (e.title == '我的爱心' || e.title == '今日爱心') {
          // 跳转 我的爱心
          uni.navigateTo({
            url: "/pages/research/myLove/index"
          })
        } else if (e.title == '公益积分') {
          // 跳转 我的公益积分
          uni.navigateTo({
            url: "/pages/research/myPublicWelfare/index"
          })
        } else if (e.title == '优惠券') {
          uni.navigateTo({
            url: "/pages/couponCenter/index?isMyCoupon=true"
          })
        }
      },
      toolClick(funName) {
        if (!funName) {
          uni.showToast({
            icon: 'none',
            title: '暂无功能'
          })
          return false;
        }
        this[funName]();
      },
      rest() {
        this.userInformation = {}
        this.myCommunity = {}
      },
      async getAll() {
        this.rest() //清空消息
        await this.judgeLogin() //判断是否登录
        if (this.isLogin) {
          // await this.getUnreadNum()	//未读消息
          await this.getMyStatistics() //登录消息
          await this.getuserInfo() //用户消息
          this.$forceUpdate();
        }
      },

      //获取未读消息
      // getUnreadNum(){
      // 	this.$http.get(unreadNum).then(res=>{
      // 		uni.stopPullDownRefresh();
      // 		if(res&&res.code==200){
      // 			this.myMsg = res.data
      // 		}
      // 	})
      // },
      //前往我的二维码
      jumpcode() {
        uni.navigateTo({
          url: "../user/invitationCode/invitationCode"
        })
      },
      //前往我的钱包
      goToMyWallet() {
        let token = uni.getStorageSync("token")
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          uni.navigateTo({
            url: "../user/wallet/myWallet"
          })
        }

      },
      //前往我的积分
      goToMyPoints() {

        let token = uni.getStorageSync("token")
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          uni.navigateTo({
            url: "../research/community/mypoints"
          })
        }
      },
      getMyStatistics() {
        //获取主页数据
        this.$http.get(myStatistics)
          .then(res => {
            uni.stopPullDownRefresh();
            if (res && res.code == 200) {
              this.myCommunity = res.data
            }
          })
      },
      //判断是否登录
      async judgeLogin() {
        let shop = uni.getStorageSync("shop")
        if (shop) {
          await this.$http.get(getAccountInfo).then(res => {
            uni.stopPullDownRefresh();
            if (res && res.code == 200) {
              this.isLogin = true
              this.userInformation = res.data;
              this.topData[0].value = res.data.love_value;
              this.topData[1].value = res.data.today_love_value;
              this.topData[2].value = '￥' + res.data.integral_able;
              this.topData[3].value = res.data.coupon_num + '张';
              this.isSign = res.data.sign_in;
              this.topData[0].value = res.data.love_value || 0;
              this.topData[1].value = res.data.today_love_value || 0;
              this.topData[2].value = res.data.integral_able || 0;
              this.topData[3].value = (res.data.coupon_num || 0) + '张';
            } else {
              this.isLogin = false
            }
          })
        } else {
          this.isLogin = false
        }

      },
      //跳转成为商家
      goToRegisterAndAudit() {
        let token = uni.getStorageSync("token")
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          this.$http.get("/yxt/shopapply/shopApplyInfo").then(res => {
            if (res && res.code == 200) {
              if (res.data == null) {
                uni.navigateTo({
                  url: "../user/merchant/registerAndAudit"
                })
              } else {
                uni.navigateTo({
                  url: "../user/merchant/audit"
                })
              }
            }
          })
          // 	let personal = uni.getStorageSync("personal")
          // 	let isShop = personal.is_shop
          // 	if(isShop==true){
          // 	uni.navigateTo({
          // 	url:"../research/setup/toBusiness"
          // })}else{
          // 		uni.navigateTo({
          // 		url:"../user/merchant/registerAndAudit"
          // 	})
          // 	}
        }
      },
      //成为网红
      goTobecomeANerStar() {
        let token = uni.getStorageSync("token")
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          //获取申请信息
          this.$http.get("/celebrity/info").then(res => {
            if (res && res.code == 200) {
              if (res.data !== null) {
                uni.navigateTo({
                  // url:"./toExamine"
                  url: "../research/setup/toExamine"
                })
              } else {
                uni.navigateTo({
                  url: "../research/setup/becomeANetStar"
                })
              }

            }
          })
        }



      },

      //跳转我的银行卡
      goToBankCardList() {
        let token = uni.getStorageSync("token")
        if (!token) {

          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          uni.navigateTo({
            url: "../user/bankCard/bankCardList"
          })
        }

      },

      //跳转分销中心
      goToDistributionCentre() {
        let token = uni.getStorageSync("token")
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          uni.navigateTo({
            url: "../user/distribution/distributionCentre"
          })
        }
      },
      //跳转我的评论
      goToMyComment() {
        let token = uni.getStorageSync('token')
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          uni.navigateTo({
            url: "../research/community/mycomment?user_id=" + this.userInfo.id
          })
        }

      },
      //跳转我的点赞
      goToMyFabulous() {
        let token = uni.getStorageSync('token')
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          uni.navigateTo({
            url: "../research/community/myfabulous?user_id=" + this.userInfo.id
          })
        }

      },
      //跳转我的关注
      goToMyFollow() {
        let token = uni.getStorageSync('token')
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          uni.navigateTo({
            url: "../research/community/myfollow?user_id=" + this.userInfo.id
          })
        }

      },
      //跳转我的发布
      goToMyRelease() {
        let token = uni.getStorageSync('token')
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          uni.navigateTo({
            url: "../research/community/myrelease?user_id=" + this.userInfo.id
          })
        }

      },
      //跳转我的主页
      goToHomepage() {
        let token = uni.getStorageSync('token')
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          let id = this.userInfo.id
          uni.navigateTo({
            url: "../research/community/homepage?user_id=" + id
          })
        }
      },

      //跳转我的粉丝
      gotoFans() {
        let token = uni.getStorageSync('token')
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else {
          uni.navigateTo({
            url: "../research/community/myfans?user_id=" + this.userInfo.id
          })
        }

      },
      //跳转注册
      goToRegister() {
        uni.navigateTo({
          url: "../research/register/register"
        })
      },
      //跳转登录
      goToLogin() {
        uni.navigateTo({
          url: "../research/register/login"
        })
      },
      getuserInfo() {
        let shop = uni.getStorageSync('shop')
        this.$http.get('/account/getAccountInfo/' + shop.id).then(async res => {
          uni.stopPullDownRefresh();
          if (res && res.code == 200) {
            this.userInfo = res.data
          }
        })
      },
      //跳到登录页面
      // goLogin(url){
      // let token = uni.getStorageSync('token')
      // //判断是否微信授权登录（没有授权登录进wx-login,授权了但没有注册进login）
      // if(!token){
      // 	uni.navigateTo({
      // 		url:"./wx-login"
      // 	})
      // }else if(token){
      // 	this.hiddenLink =false
      // 	uni.navigateTo({
      // 		url:url
      // 	})
      // }
      // },
      //跳到商家页
      goMerchant() {
        let token = uni.getStorageSync('token')
        //判断是否微信授权登录（没有授权登录进wx-login,授权了但没有注册进login）
        if (!token) {
          uni.navigateTo({
            url: "./wx-login"
          })
        } else if (token) {
          this.hiddenLink = false
          this.$http.get('/yxt/shopapply/shopApplyInfo', {}).then(async res => {
            if (res && res.code == 200) {
              if (!res.data) {
                uni.navigateTo({
                  url: "../user/merchant/registerAndAudit"
                })
              } else {
                uni.navigateTo({
                  url: '../user/merchant/audit'
                })
              }
            }
          })
        }
      },

      //跳到订单列表
      linkOrderList(k) {
        let token = uni.getStorageSync('token')
        //判断是否微信授权登录（没有授权登录进wx-login,授权了但没有注册进login）
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else if (token) {
          this.hiddenLink = false
          uni.navigateTo({
            url: `../order/orderList/orderList?keys=${k}&orderType=${this.orderTypeList[this.orderTypeIndex].value}`
          })
        }
      },
      //跳服务订单列表
      linkServiceOrderList(v) {
        let token = uni.getStorageSync('token')
        //判断是否微信授权登录（没有授权登录进wx-login,授权了但没有注册进login）
        if (!token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
        } else if (token) {
          this.hiddenLink = false
          uni.navigateTo({
            url: "../order/orderList/serviceOrder?keys=" + v
          })
        }
      },
      //跳到拼团订单
      goGbOrder() {
        uni.navigateTo({
          url: "../order/gbOrder/gbOrderList"
        })
      },
      //常见问题
      goFaq() {
        uni.navigateTo({
          url: "../user/faq"
        })
      },
      //获取服务订单统计
      getServiceOrderCount() {
        this.$http.get('/order/service-order-count', {}).then(async res => {
          if (res && res.code == 200) {
            if (res.data) {
              this.serviceOrder.waitPayNum = res.data.wait_pay_num //待支付
              this.serviceOrder.waitCommentNum = res.data.wait_comment_num //待评论
              this.serviceOrder.waitUseNum = res.data.wait_use_num //待使用
            }
          }
        })
      },
      //获取普通订单统计
      getGeneralOrderCount() {
        this.$http.get(this.orderTypeIndex == 0 ? '/order/general-order-count' : '/order/apply-order-count', {})
          .then(async res => {
            if (res && res.code == 200) {
              if (res.data) {
                this.generalOrder.waitPayNum = res.data.wait_pay_num //待支付
                this.generalOrder.waitCommentNum = res.data.wait_comment_num //待评论
                this.generalOrder.waitUseNum = res.data.wait_use_num //待使用
                this.generalOrder.waitReceivingNum = res.data.wait_receiving_num //待收货
                this.generalOrder.waitShipNum = res.data.wait_ship_num //待发货
              }
            }
          })
      },
      tabPage(url, needLogin = false) {
        let token = uni.getStorageSync("token")
        if (needLogin && !token) {
          uni.navigateTo({
            url: "../research/register/login"
          })
          return;
        }
        uni.navigateTo({
          url
        })
      },
      // 获取联盟商家订单统计信息
      getAffiliateMerchantOrder() {
        this.$http.get('/offlineorder/mycount').then(res => {
          if (res.code == 200) {
            this.affiliateMerchantOrderInfo = res.data
          }
        })
      },
      // 跳转联盟商家列表
      affiliateMerchantOrderList() {
        uni.navigateTo({
          url: '/pages/workbench/order/coalitionList'
        })
      }
    }
  }
</script>
<style>
  page {
    background-color: #FFFFFF;
  }
</style>
<style lang="scss" scoped>
  .hx-navbar {
    /deep/ .hx-navbar__content {
      background-color: #FF721B !important;

      .hx_text_overflow {
        color: #fff !important;
      }
    }
  }

  .goodBug {
    font-size: 40rpx;
    color: #FFFFFF;
    font-weight: 400;
    width: 400rpx;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-top: 30rpx;
  }

  // 我的钱包
  .money-and-integral {
    margin-left: 30rpx;
    margin-right: 30rpx;
    margin-top: 24rpx;
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: #ffffff;

    .money {
      text-align: center;

      .num {
        font-size: 48rpx;
        color: #ffffff;
        font-weight: Bold;

        text {
          font-size: 28rpx;
          font-weight: Medium;
          flood-color: #ffffff;
        }
      }
    }

    .middle-line {
      background-color: #FFFFFF;
      height: 70rpx;
      width: 1rpx;
      opacity: 0.53;
    }

    .integral {
      text-align: center;

      .num {
        font-size: 48rpx;
        font-weight: Bold;
        color: #ffffff;

        text {
          font-size: 28rpx;
          font-weight: Medium;

        }
      }

      .my-integral {
        margin-top: 4rpx;

        .iconfont {
          width: 46rpx;
          height: 46rpx;
          background-color: #ffffff;
          color: #29A549;
          border-radius: 999rpx;
          text-align: center;
          line-height: 46rpx;
        }

        .my-iconfont-item {
          font-size: 28rpx;
          font-weight: Medium;
          color: #ffffff;
          margin-left: 8rpx;
          height: 46rpx;
          line-height: 46rpx;
        }
      }
    }

    .my-integral {
      display: flex;
    }

    .my-money {
      margin-top: 4rpx;
      display: flex;

      .iconfont {
        background-color: #ffffff;
        color: #29A549;
        width: 46rpx;
        height: 46rpx;
        border-radius: 999rpx;
        text-align: center;
        line-height: 46rpx;
      }

      .my-money-item {
        margin-left: 8rpx;
        font-size: 28rpx;
        font-weight: Medium;
        height: 46rpx;
        line-height: 46rpx;
      }
    }
  }


  .navbar {
    position: absolute;
    top: 0;
    left: 0;
  }

  .top {
    position: relative;
    min-height: 100vh;
    background-color: #F6F6F6;
  }

  .bgImg {
    // position: absolute;
    // top: 480rpx;
    width: 100%;
    padding: 30rpx;
    // margin: 60rpx 0 30rpx;
  }

  .bgImg image {
    width: 100%;
    // height: 103vh;
    position: relative;
  }

  .position-ab {
    // position: relative;
    // top: -45rpx;
    width: 100%;
    // padding-bottom: 175rpx;
    border-radius: 20rpx;
	background-color: #ffffff;
    // box-shadow: 0 0 40rpx rgba(0, 0, 0, .1);

    .middle {
      margin: 0 30rpx;
      background: #ffffff;
      // margin-top: 32rpx;
      border-radius: 20rpx;
      padding-bottom: 50rpx;

      .middle-content {
        display: flex;
        justify-content: space-around;

        .list {
          flex: 1;
          text-align: center;

          .my-icon {
            width: 68rpx;
            height: 56rpx;
			margin-top: 30rpx;
          }
		  
		  .my-icon1 {
			width: 45rpx;
			height: 56rpx;
			margin-top: 30rpx;
		  }

          .name-one {
            font-size: 28rpx;
            color: #AAAAAA;
            font-weight: 400;
            margin-top: 18rpx;
          }

          .anglenum {
            position: absolute;
            margin-left: 92rpx;
            margin-top: 4rpx;
            background-color: #ff0000;
            padding: 0px 11rpx;
            border-radius: 100rpx;
            font-weight: 400;
            font-size: 23rpx;
            color: #ffffff
          }

          .one {
            font-size: 52rpx;
            // background: linear-gradient(180deg, #78df6a, #11d688);
            background: #f35427;
            -webkit-background-clip: text;
            color: transparent;
          }

          .two {
            font-size: 50rpx;
            // background: linear-gradient(180deg, #dc9c56, #ff7303);
            background: #ff9301;
            -webkit-background-clip: text;
            color: transparent;
          }

          .three {
            font-size: 52rpx;
            // background: linear-gradient(180deg, #05d3a9, #06b806);
            background: #ea632a;
            -webkit-background-clip: text;
            color: transparent;
          }

          .four {
            font-size: 52rpx;
            // background: linear-gradient(180deg, #ff5475, #fd4303);
            background: #f2ad41;
            -webkit-background-clip: text;
            color: transparent;
          }

          .five {
            font-size: 52rpx;
            // background: linear-gradient(180deg, #b175f0, #3db3fd);
            background: #2e6cf6;
            -webkit-background-clip: text;
            color: transparent;
          }
        }
      }

      .middle-top {
        margin: 0 0 30rpx;
        margin-bottom: 32rpx;
        border-bottom: 1rpx solid #e6e6e6;
        display: flex;
        padding: 30rpx 0;
        justify-content: space-between;
        align-items: center;

        .order {
          font-size: 36rpx;
          color: #474747;
          display: block;

          &.active {
            color: #1A1A1A;
            font-weight: Bold;
          }
        }

        .whole {
          display: flex;
          align-items: center;
          color: #999999;
          font-size: 24rpx;
          font-weight: 400;

          .whole-top {
            color: #AAAAAA;
            font-size: 28rpx;
            font-weight: 400;
          }

          .wholeright {
            color: #AAAAAA;
            font-size: 35rpx;
            // margin-top: 4rpx;
            margin-left: 16rpx;
          }
        }
      }

    }


    .other {
      margin: 30rpx;
      background-color: #ffffff;
      // padding: 50rpx 0;
      border-radius: 20rpx;

      .option {
        display: flex;
        justify-content: space-between;

        .list {
          text-align: center;

          .my-icon {
            width: 52rpx;
            height: 50rpx;
          }

          .name-one {
            font-size: 26rpx;
            color: #1a1a1a;
            font-weight: 400;
            margin-top: 18rpx;
          }

          .othernum {
            position: absolute;
            margin-left: 65rpx;
            margin-top: -10rpx;
            background-color: #ff0000;
            padding: 0px 11rpx;
            border-radius: 100rpx;
            font-weight: 400;
            color: #ffffff;
            font-size: 23rpx;
          }

          .one {
            font-size: 52rpx;
            background: linear-gradient(180deg, #78df6a, #11d688);
            -webkit-background-clip: text;
            color: transparent;
          }

          .two {
            font-size: 50rpx;
            background: linear-gradient(180deg, #dc9c56, #ff7303);
            -webkit-background-clip: text;
            color: transparent;
          }

          .four {
            font-size: 52rpx;
            background: linear-gradient(180deg, #ff5475, #fd4303);
            -webkit-background-clip: text;
            color: transparent;
          }

          .five {
            font-size: 52rpx;
            background: linear-gradient(180deg, #b175f0, #3db3fd);
            -webkit-background-clip: text;
            color: transparent;
          }
        }
      }

      .other-top {
        display: flex;
        // padding-bottom: 18rpx;
		padding: 30rpx 0;
        align-items: center;
        margin-bottom: 50rpx;
        border-bottom: 1rpx solid #e6e6e6;

        .left {
          flex: 1;
          font-size: 36rpx;
          font-weight: Bold;
          color: #474747;
          // line-height: 30rpx;
        }

        .right {
          color: #AAAAAA;
          font-size: 28rpx;
          line-height: 30rpx;
          font-weight: 400;
          display: flex;
          align-items: center;

          .other-icon {
            color: #AAAAAA;
            margin-left: 16rpx;
            font-size: 15rpx;
          }
        }
      }

      .order-info {
        display: flex;
        justify-content: space-around;
        align-items: center;
        font-size: 26rpx;
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: 400;
        color: #AAAAAA;
        padding-bottom: 66rpx;

        .item {
          max-width: 30%;
          text-align: center;

          .num {
            font-size: 36rpx;
            color: #FF721B;
            margin-bottom: 18rpx;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
			margin-top: 20rpx;
          }
        }
      }
    }

    .tool {
      margin: 0rpx 30rpx 30rpx 30rpx;
      padding: 18rpx 30rpx;
      background-color: #ffffff;
      border-radius: 20rpx;

      .image-text {
        .list-top {
          display: flex;
          justify-content: space-around;
        }

        .list-bottom {
          display: flex;
          justify-content: space-around;
        }

        .item-one {
          text-align: center;
          width: 25%;

          image {
            text-align: center;
            width: 80rpx;
            height: 80rpx;
            padding: 34rpx 10rpx 14rpx 10rpx;
          }

          .item-name {
            text-align: center;
            font-size: 26rpx;
            font-weight: 400;
            padding-bottom: 44rpx;
            color: #1A1A1A;
          }
        }
      }

      .tool-top {
        padding: 18rpx 0rpx 18rpx 0rpx;
        border-bottom: 1rpx solid #e6e6e6;
        font-size: 30rpx;
        font-weight: 700;
        font-family: 700;
        color: #1a1a1a;
        line-height: 30rpx;
      }

    }

    .wallet-bg {
      position: relative;
      height: 138rpx;
    }

    .wallet-bg .bigBg {
      position: absolute;
      z-index: 0;
      padding: 0 15rpx;
      box-sizing: border-box;
      width: 100%;
      height: 138rpx;
    }

    .wallet image {
      width: 32rpx;
      height: 34rpx;
    }

    .my-wallet {
      position: relative;
      z-index: 1;
      height: 138rpx;
    }
  }


  .guess {
    margin: 0 30rpx;

    .guess-item {
      display: flex;
      // justify-content: space-around;
      flex-wrap: wrap;

      .item {
        margin-bottom: 36rpx;
        // background-color: #ffffff;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        // border-radius: 20rpx 20rpx 0 0;
        // box-shadow: 0 0 40rpx rgba(0, 0, 0, .1);

        image {
          width: 336rpx;
          height: 336rpx;
          // border-radius: 18rpx;
        }

        .name {
          margin: 6rpx;
          width: 318rpx;
          height: 70rpx;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          word-wrap: break-word;
          word-break: break-all;
          white-space: normal !important;
		  color: #474747;
        }

        .tag-box {
          margin: 10rpx 20rpx 0 20rpx;

          .tag1 {
            width: 69rpx;
            height: 30rpx;
          }

          .tag2 {
            width: 116rpx;
            height: 30rpx;
            margin-left: 10rpx;
          }
        }

        .number {
          display: flex;
          align-items: flex-end;
          // padding-bottom: 40rpx;
          // margin: 0 20rpx 0 20rpx;
		  margin: 30rpx 0 16rpx 0;

          .number-red {
            color: #FF721B;
            font-size: 36rpx;
            // font-weight: 700;

            text {
              font-size: 36rpx;
              font-weight: Bold;
            }
          }

          .number-grey {
            color: #AAAAAA;
            font-size: 32rpx;
            font-weight: 400;
            text-decoration: line-through;
            margin-left: 16rpx;
            padding-bottom: 4rpx;
          }
        }
      }

      .item:nth-child(2n) {
        margin-left: 18rpx;
      }
    }

    .guess-top {
      display: flex;
      align-items: center;
      margin-bottom: 28rpx;

      .guess-left {
        font-size: 36rpx;
        color: #474747;
        font-weight: Bold;
        line-height: 30rpx;
      }

      .guess-line {
        width: 1rpx;
        height: 32rpx;
        background-color: #9e9e9e;
        margin: 0 16rpx;
      }

      .guess-right {
        font-size: 24rpx;
        color: #474747;
        font-weight: Regular;
        line-height: 24rpx;
      }
    }
  }

  .top-data-box2 {
    width: 690rpx;
    margin: 0 auto;
    height: 133rpx;
    background: #ffffff;
    border-radius: 20rpx;
    padding: 30rpx 30rpx;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .item {
      text-align: center;
      display: flex;
      justify-content: space-between;
      align-items: center;

      .icon {
        width: 50rpx;
        height: 50rpx;
        border-radius: 50%;
        background: #138e46;
        margin: 0 auto 0 6rpx;

        &.active {
          background: #FF4141;
        }

        .iconfont2 {
          font-size: 28rpx;
          line-height: 50rpx;
          color: white;
        }
      }

      .title {
        font-size: 28rpx;
        font-family: PingFang SC, PingFang SC-Bold;
        font-weight: 700;
        color: #1a1a1a;
        margin-bottom: 3rpx;
      }

      .tip {
        font-size: 24rpx;
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: 400;
        color: #808080;
      }
    }
  }
</style>
